home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #7 / utv2n7s1.d64 / outline gen (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  7.6 KB  |  244 lines

  1. 10 clr:dim ch(50),l(200),c(6),t$(50),cl$(6,26),sp$(20),in$(200)
  2. 20 ai$="[201]nvalid [193]nswer!":poke 53280,0:poke 53281,0
  3. 30 lt=200:sp$(1)=" ":for x=2 to 20:sp$(x)=sp$(x-1)+" ":next:print"";
  4. 40 print"[147]"
  5. 50 s$="[208]resenting":gosub 2200:print:s$="[207]utline [199]enerator":gosub 2220
  6. 60 print:s$="by":gosub 2200:print:s$="[196]avid [204]eithauser":gosub 2200
  7. 70 print:print:s$="[195]opyright 1988 by [211]oftdisk [208]ublishing":gosub 2200:print:print
  8. 80 for x=1 to 26
  9. 90 read cl$(1,x):cl$(2,x)=chr$(96+x)+".":cl$(3,x)=mid$(str$(x),2)+"."
  10. 100 cl$(4,x)=chr$(64+x)+".":cl$(5,x)="("+mid$(str$(x),2)+")"
  11. 110 cl$(6,x)="("+chr$(64+x)+")"
  12. 120 next
  13. 130 data "[201].","[201][201].","[201][201][201].","[201][214].","[214].","[214][201].","[214][201][201].","[214][201][201][201]."
  14. 140 data "[201][216].","[216].","[216][201].","[216][201][201].","[216][201][201][201].","[216][201][214].","[216][214]."
  15. 150 data "[216][214][201].","[216][214][201][201].","[216][214][201][201][201].","[216][201][216].","[216][216].","[216][216][201]."
  16. 160 data "[216][216][201][201].","[216][216][201][201][201].","[216][216][201][214].","[216][216][214].","[216][216][214][201]."
  17. 170 print"[159]":s$="[204]oad file from disk":gosub 2060
  18. 180 if yn=0 then 260
  19. 190 print:print"[154][198]ile name (just [210][197][212][213][210][206] aborts)?":print">";:gosub 2500:f$=i$
  20. 200 if f$="" then 260
  21. 210 t=0:open 1,8,2,f$+",s,r":input#1,t:if t>0 then 230
  22. 220 close 1:s$="[158][198]ile invalid or not found.":gosub 2200:goto 170
  23. 230 for x=0 to t:input#1,in$(x):input#1,l(x):next
  24. 240 close 1:ds=-1:goto 800
  25. 250 rem   create file
  26. 260 print "[147][154]"
  27. 270 s$="[215]hat is the name of your project?":gosub 2200:print
  28. 280 print">";
  29. 290 gosub 2500:in$(0)=i$:if in$(0)<>"" then 310
  30. 300 print"[147][158]":s$="[201]nput project name.":gosub 2200:print">";:goto 290
  31. 310 print"[147]";
  32. 320 ll=0:ul=0:gosub 330:goto 800
  33. 330 l=l+1
  34. 340 dc=0:n=ll
  35. 350 s=n+1
  36. 360 if l(n)<l-1 or l(n)>5 then 760
  37. 370 if l(n)<2 then 420
  38. 380 for ts=n to 1 step -1
  39. 390 if l(ts)=1 then 410
  40. 400 next
  41. 410 tl=n:gd=1:yn=0:print"[147]";:gosub 1120:print
  42. 420 ns=0:s$="[215]hat are the steps/subdivisions of":gosub 2200
  43. 430 sn$=chr$(34)+in$(n)+chr$(34):s$=sn$+"?":gosub 2200
  44. 440 s$="[158][208]ress just [210][197][212][213][210][206] when finished. ":gosub 2200
  45. 450 print">";
  46. 460 gosub 2500:a$=i$
  47. 470 if a$="" then 540
  48. 480 if t=lt then gosub 2270:return
  49. 490 for x=t+1 to n+2 step -1:in$(x)=in$(x-1):l(x)=l(x-1):next
  50. 500 n=n+1:t=t+1:ul=ul+1:l(n)=l:in$(n)=a$:dc=-1
  51. 510 ns=ns+1:if ns<26 then 450
  52. 520 gosub 7040:s$="[206]o more subdivisions allowed for":gosub 2200
  53. 530 s$=sn$:gosub 2200:gosub 2320:print chr$(147);
  54. 540 if n-s<1 then 760
  55. 550 s$="[196]o these steps need to be in any":gosub 2200
  56. 560 s$="particular order":gosub 2060
  57. 570 if yn=0 then 760
  58. 580 s$="[193]re these steps in the correct":gosub 2200
  59. 590 s$="order now":gosub 2060
  60. 600 if yn then 760
  61. 610 gosub 2130
  62. 620 for x=0 to c:t$(x)=in$(s+x):next:for x=0 to 50:ch(x)=0:next
  63. 630 print"[215]hich of these should be first ([201]nput   number)";
  64. 640 for x=0 to c
  65. 650 gosub 2500:f=val(i$)
  66. 660 if f=>1 and f<=c+1 then 680
  67. 670 s$="[158][201]nvalid number!":gosub 2200:print"";:goto 650
  68. 680 if ch(f)=0 then 710
  69. 690 s$="[158][193]lready taken.":gosub 2200:print"";
  70. 700 print "[195]orrect number";:goto 650
  71. 710 in$(s+x)=t$(f-1):ch(f)=-1
  72. 720 if x<c then print "[206]ext";
  73. 730 next
  74. 740 gosub 2130
  75. 750 goto 580
  76. 760 print"[147]";:n=n+1:if n<=ul then 350
  77. 770 if dc then 330
  78. 780 return
  79. 790 rem  menu
  80. 800 print"[147]":s$="[205]ain [205]enu":gosub 2220:print
  81. 810 s$="1) [207]utput [207]utline               ":gosub 2200
  82. 820 s$="2) [211]ave [207]utline to [196]isk         ":gosub 2200
  83. 830 s$="3) [205]odify [207]utline               ":gosub 2200
  84. 840 s$="4) [211]tart or [204]oad [193]nother [207]utline":gosub 2200
  85. 850 s$="5) [197]xit to [213]p[212]ime               ":gosub 2200
  86. 860 print"":s$=" [206]umber of your choice? ":gosub 2260
  87. 870 get a$
  88. 880 if a$<"1" or a$>"5" then 870
  89. 890 print a$:on val(a$) goto 910,1220,1290,1940,1970
  90. 910 print "[147]":s$="[207]utput to:":gosub 2200:print:s$="1) [211]creen ":gosub 2200
  91. 920 s$="2) [208]rinter":gosub 2200:s$="3) [196]isk   ":gosub 2200:print
  92. 930 printtab(8)"[154][206]umber of your choice? ";
  93. 940 get s$:if s$<"1" or s$>"3" then 940
  94. 950 print s$:gd=val(s$):if gd=1 then 1030
  95. 960 if gd=2 then 1020
  96. 970 print "[198]ile name? ";:gosub 2360:f$=i$:if f$="" then 970
  97. 980 open 1,8,2,"@:"+f$+",s,w"
  98. 990 ts=1:tl=t:yn=0:print#1,"[208]roject: "+in$(0):gosub 1110
  99. 1000 close 1
  100. 1010 gd=1:goto 800
  101. 1020 print chr$(147);:s$="[208]reparing to print outline":print                 
  102. 1030 print:s$="[196]o you want line numbers":gosub 2060
  103. 1040 if gd<>2 then 1060
  104. 1050 s$="[208]repare printer, then press space bar.":gosub 2200:gosub 2330:open 1,4
  105. 1060 ts=1:tl=t:gosub 1100
  106. 1070 if gd=1 then gosub 2320
  107. 1080 if gd=2 then close 1:gd=1
  108. 1090 goto 800
  109. 1100 if gd=2 then print#1,"        [208]roject: ";in$(0):print#1,""
  110. 1110 print"[147]";:s$="[208]roject: "+in$(0):gosub 2200:print
  111. 1120 for x=1 to tl
  112. 1130 c(l(x))=c(l(x))+1:if l(x)>l(x-1) then c(l(x))=1
  113. 1140 a$=sp$(2*l(x)-2)+cl$(l(x),c(l(x)))+" "+in$(x)
  114. 1150 if yn then a$=mid$(str$(x),2)+sp$(4-len(str$(x)))+a$
  115. 1160 if x=>ts then print a$:if gd>1 then print#1,a$
  116. 1170 if gd>1 then 1190
  117. 1180 if peek(214)>21 and x<tl then gosub 2320:print"[147]";
  118. 1190 next
  119. 1200 return
  120. 1210 rem save outline on disk
  121. 1220 gosub 1230:goto 800
  122. 1230 s$="[198]ile name? ":gosub 2260:gosub 2500:f$=i$
  123. 1240 close 1:open 1,8,2,"@:"+f$+",s,w"
  124. 1250 print#1,t
  125. 1260 for x=0 to t:print#1,chr$(34)+in$(x)+chr$(34):print#1,l(x):next
  126. 1270 close 1:ds=-1:return
  127. 1280 rem modify outline
  128. 1290 print"[147]":s$="[205]odify [207]utline [205]enu":gosub 2220:print
  129. 1300 s$="1) [195]hange line        ":gosub 2200
  130. 1310 s$="2) [196]elete line        ":gosub 2200
  131. 1320 s$="3) [201]nsert after line  ":gosub 2200
  132. 1330 s$="4) [201]nsert before line ":gosub 2200
  133. 1340 s$="5) [201]nsert subdivisions":gosub 2200
  134. 1350 s$="6) [196]isplay outline    ":gosub 2200
  135. 1360 s$="7) [197]nd modifications  ":gosub 2200
  136. 1370 print"":s$="   [206]umber of your choice? ":gosub 2260
  137. 1380 get a$:if a$<"1" or a$>"7" then 1380
  138. 1390 ds=0:print a$:print
  139. 1400 if a$>"5" then 1430
  140. 1410 print "[147][158]";:s$="[210][197][212][213][210][206] alone aborts modification"
  141. 1420 gosub 2200:print"";
  142. 1430 on val(a$) goto 1440,1500,1590,1720,1830,1910,800
  143. 1440 s$="[204]ine number to change? ":gosub 2260:gosub 2500:ln=val(i$)
  144. 1442 if ln=0 then 1290
  145. 1450 if ln<0 or ln>t then gosub 2350:goto 1440
  146. 1460 s$="[204]ine reads:":gosub 2200:print:s$=in$(ln):gosub 2200
  147. 1470 print:s$="[206]ew line?":gosub 2200:print"";
  148. 1480 gosub 2500:a$=i$:if a$="" then 1290
  149. 1490 in$(ln)=a$:goto 1290
  150. 1500 s$="[204]ine number to delete? ":gosub 2260:gosub 2500:ln=val(i$)
  151. 1502 if ln=0 then 1290
  152. 1510 if ln<0 or ln>t then gosub 2350:goto 1500
  153. 1520 s$="[204]ine reads:":gosub 2200:s$=in$(ln):gosub 2200
  154. 1530 s$="[196]elete":gosub 2060:if yn=0 then 1500
  155. 1540 ll=l(ln):for x=ln to t-1:in$(x)=in$(x+1):l(x)=l(x+1):next
  156. 1550 in$(t)="":l(t)=0:t=t-1
  157. 1560 if l(ln)<=ll then 1290
  158. 1570 for x=ln to t-1:in$(x)=in$(x+1):l(x)=l(x+1):next x
  159. 1580 in$(t)="":l(t)=0:t=t-1:goto 1560
  160. 1590 if t=lt then gosub 2270:goto 1290
  161. 1600 s$="[201]nsert after which line number? ":gosub 2260
  162. 1610 gosub 2500:ln=val(i$):if ln=0 then 1290
  163. 1620 if ln<0 or ln>t then gosub 2350:goto 1590
  164. 1630 s$="[201]nserting after":gosub 2200
  165. 1640 s$=in$(ln):gosub 2200:print"";
  166. 1650 s$="[201]nsert what?":gosub 2200
  167. 1660 print"";:gosub 2500:a$=i$:if a$="" then 1290
  168. 1670 l=l(ln)
  169. 1680 if l<l(ln+1) then ln=ln+1:goto 1680
  170. 1690 for x=t+1 to ln+2 step -1:in$(x)=in$(x-1):l(x)=l(x-1):next x:t=t+1
  171. 1700 in$(ln+1)=a$:l(ln+1)=l
  172. 1710 print chr$(147);:ll=ln+1:ul=ln+1:gosub 330:goto 1290
  173. 1720 if t=lt then gosub 2270:goto 1290
  174. 1730 s$="[201]nsert before which line? ":gosub 2260
  175. 1740 gosub 2500:ln=val(i$):if ln=0 then 1290
  176. 1750 if ln<0 or ln>t then gosub 2350:goto 1720
  177. 1760 s$="[201]nserting before":gosub 2200
  178. 1770 s$=in$(ln):gosub 2200:print"";
  179. 1780 s$="[201]nsert what?":gosub 2200
  180. 1790 print"";:gosub 2500:a$=i$:if a$="" then 1290
  181. 1800 for x=t+1 to ln+1 step -1:in$(x)=in$(x-1):l(x)=l(x-1):next x:t=t+1
  182. 1810 in$(ln)=a$
  183. 1820 print"[147]";:l=l(ln):ll=ln:ul=ln:gosub 330:goto 1290
  184. 1830 if t=lt then gosub 2270:goto 1290
  185. 1840 s$="[204]ine number to insert":gosub 2200:s$="subdivisions for? ":gosub 2260
  186. 1850 gosub 2500:ln=val(i$):if ln=0 then 1290
  187. 1860 if l(ln)<6 then 1890
  188. 1870 s$="[158][206]o subdivisions of this level allowed!":gosub 2200
  189. 1880 gosub 2320:goto 1290
  190. 1890 if ln<0 or ln>lt then gosub 2350:goto 1830
  191. 1900 goto 1820
  192. 1910 print"[147]";:gd=1:yn=-1:tl=t:ts=1:gosub 1120
  193. 1920 gosub 2320
  194. 1930 goto 1290
  195. 1940 if ds then run
  196. 1950 gosub 2020:if yn then gosub 1230
  197. 1960 run
  198. 1970 print"[159]":s$="[197]xit [207]utline [199]enerator":gosub 2060
  199. 1980 if yn=0 then 800
  200. 1990 if ds then 2010
  201. 2000 gosub 2020:if yn then gosub 1230
  202. 2010 sys32774 : rem return to uptime
  203. 2020 print:print:s$="[196]ata has been modified since it was":gosub 2200
  204. 2030 s$="last saved on disk.  [196]o you want to":gosub 2200
  205. 2040 s$="save it before destroying it":gosub 2060
  206. 2050 return
  207. 2060 s$=s$+" ([217]/[206])? "
  208. 2070 print tab((40-len(s$))/2);s$;:yn=0:poke 198,0
  209. 2080 get h$:if h$<>"[217]" and h$<>"y" and h$<>"[206]" and h$<>"n" then 2080
  210. 2090 if h$="[217]" or h$="y" then yn=-1
  211. 2100 print h$
  212. 2110 return
  213. 2120 rem display portion of outline
  214. 2130 print "[147]";:s$="[208]resent order of steps is:":gosub 2200
  215. 2140 c=-1
  216. 2150 for x=s to n
  217. 2160 c=c+1
  218. 2170 print c+1") "in$(x)
  219. 2180 next
  220. 2190 return
  221. 2200 if len(s$)<39 then print tab((40-len(s$))/2);s$:return
  222. 2210 print s$:return
  223. 2220 print"":z1=((40-len(s$))/2)-1
  224. 2230 z$="":for z=1 to len(s$)+2:z$=z$+" ":next:print tab(z1);chr$(18);z$
  225. 2240 print tab(z1);chr$(18);" ";s$;" ":print tab(z1);chr$(18);z$
  226. 2250 print"":return
  227. 2260 print tab((40-len(s$))/2-1);s$;:return
  228. 2270 s$="[207]ut of memory.  [206]o more additions":gosub 2200
  229. 2280 s$="to outline possible.":gosub 2200:gosub 2320:print"";:return
  230. 2320 print"[158]":s$="[208]ress [211]pacebar.":gosub 2260
  231. 2330 get z$:if z$<>" " then 2330
  232. 2340 return
  233. 2350 s$=ai$:print"";:gosub 2200:print"";:return
  234. 2500 i$="":print"[164]";
  235. 2510 get ii$:if ii$="" then 2510
  236. 2520 if ii$=chr$(13) then printchr$(20):return
  237. 2530 if ii$=chr$(20) and i$="" then 2510
  238. 2540 if ii$=chr$(20) then i$=left$(i$,len(i$)-1):printii$;ii$"[164]";
  239. 2550 if ii$<" " or ii$>"[218]" then 2510
  240. 2560 if ii$>"z" and ii$<"[193]" then 2510
  241. 2570 if ii$=chr$(34) then 2510
  242. 2580 if len(i$)=20 then 2510
  243. 2590 print"[157]"ii$"[164]";:i$=i$+ii$:goto 2510
  244.